﻿@using QuestionsAnswers.UI.Models
@model User

@{
    ViewBag.Title = "Courses";
}

<h2>Courses</h2>

<p>
    @Ajax.ActionLink("Create New", "Create",new AjaxOptions{OnSuccess = "OnSuccessGeneral",})
</p>

<h3>Courses I Created</h3>
@Html.Partial("CoursesPartial",@Model.Created)

<h3>Courses I Own</h3>
@Html.Partial("CoursesPartial",@Model.Owning)

<h3>Courses I am Participating in</h3>
@Html.Partial("CoursesPartial",@Model.Participating)

<h3>Course I have been Invited To Join</h3>
@Html.Action("InvitedTo","Invitation",@Model.InvitedTo)

<h3>Questions Assigned to me</h3>
@foreach (var item in Model.AssignedToUsers)
{
    <h4>@item.Course.Name</h4>
    @Html.Partial("QuestionsPartial",new List<Question>{item.Question})
}
